﻿using YNTK.Common.Const;
using YNTK.Common.Entity;
using SqlSugar;

namespace YNTK.SimpleWorkflow.Entitys
{
    /// <summary>
    /// 通用简易工作流信息
    /// </summary>
    [SugarTable("workflow_records")]
    [Tenant(ClaimConst.TENANT_ID)]
    public class SimpleWorkflowEntity: CLDEntityBase
    {
        /// <summary>
        /// 所属组织id
        /// </summary>
        [SugarColumn(ColumnName = "F_OrganizeId", ColumnDescription = "所属组织id", ColumnDataType = "nvarchar(50)")]
        public string OrganizeId { get; set; }

        /// <summary>
        /// 所属机构id
        /// </summary>
        [SugarColumn(ColumnName = "F_MechanismId", ColumnDescription = "所属机构id")]
        public string MechanismId { get; set; }

        /// <summary>
        /// 工作流分类id
        /// </summary>
        [SugarColumn(ColumnName = "F_ClassifyId", ColumnDescription = "工作流分类id")]
        public string ClassifyId { get; set; }

        /// <summary>
        /// 管理体系认证业务范围分类id
        /// </summary>
        [SugarColumn(ColumnName = "F_BusinessScopeId", ColumnDescription = "管理体系认证业务范围分类id")]
        public string BusinessScopeId { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        [SugarColumn(ColumnName = "F_Title", ColumnDescription = "标题")]
        public string Title { get; set; }

        /// <summary>
        /// 状态(0.未提交 1.待审核 2.审核不通过 3.已驳回 4.审核通过 5.待确认 6.已完成)
        /// </summary>
        [SugarColumn(ColumnName = "F_State", ColumnDescription = "状态(0.未提交 1.待审核 2.审核不通过 3.已驳回 4.审核通过 5.待确认 6.已完成)")]
        public int State { get; set; }

        /// <summary>
        /// 排序码
        /// </summary>
        [SugarColumn(ColumnName = "F_SortCode")]
        public long? SortCode { get; set; }

        /// <summary>
        /// 共享范围(0.全组织 1.特定机构 2.特定角色 3.特定用户 4.仅自己可见)
        /// </summary>
        [SugarColumn(ColumnName = "F_SharedScope", ColumnDescription = "共享范围(0.全组织 1.特定机构 2.特定角色 3.特定用户 4.仅自己可见)")]
        public int SharedScope { get; set; }

        /// <summary>
        /// 共享范围,多个机构/角色/用户按逗号分割,SharedScope为0或4时为空
        /// </summary>
        [SugarColumn(ColumnName = "F_SharedScopeValue", ColumnDescription = "共享范围,多个机构/角色/用户按逗号分割,SharedScope为0或4时为空")]
        public string SharedScopeValue { get; set; }

        /// <summary>
        /// 浏览次数
        /// </summary>
        [SugarColumn(ColumnName = "F_ViewCount", ColumnDescription = "浏览次数")]
        public int ViewCount { get; set; }

        /// <summary>
        /// 所有节点处理用户id,记录用于查询
        /// </summary>
        [SugarColumn(ColumnName = "F_DisposeUserIds", ColumnDescription = "所有节点处理用户id")]
        public string DisposeUserIds { get; set; }

        /// <summary>
        /// 下一处理节点id
        /// </summary>
        [SugarColumn(ColumnName = "F_NextDisposenNodeId", ColumnDescription = "下一处理节点id")]
        public string NextDisposenNodeId { get; set; }

        /// <summary>
        /// 下一节点处理人
        /// </summary>
        [SugarColumn(ColumnName = "F_NextDisposenUserId", ColumnDescription = "下一节点处理人")]
        public string NextDisposenUserId { get; set; }

        /// <summary>
        /// 当前处理节点id
        /// </summary>
        [SugarColumn(ColumnName = "F_CurrentDisposenNodeId", ColumnDescription = "当前处理节点id")]
        public string CurrentDisposenNodeId { get; set; }

        /// <summary>
        /// 当前节点处理人
        /// </summary>
        [SugarColumn(ColumnName = "F_CurrentDisposenUserId", ColumnDescription = "当前节点处理人")]
        public string CurrentDisposenUserId { get; set; }

        /// <summary>
        /// 当前节点顺序
        /// </summary>
        [SugarColumn(ColumnName = "F_Index", ColumnDescription = "当前节点顺序")]
        public int? Index { get; set; }

    }
}
